package com.itgy.project.controller;


import com.itgy.project.annotation.AuthCheck;
import com.itgy.project.common.BaseResponse;
import com.itgy.project.common.ResultUtils;
import com.itgy.project.model.vo.InterfaceInfoVO;
import com.itgy.project.service.ChartService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


/**
 * 接口统计
 */
@RestController
@RequestMapping("/analysis")
@Slf4j
public class AnalysisController {

    @Resource
    ChartService chartService;

    @GetMapping("/top/interface/invoke")
    @AuthCheck(mustRole = "admin")
    public BaseResponse<List<InterfaceInfoVO>>  listInterfaceInvoke()
    {

        List<InterfaceInfoVO> interfaceInfoVOS = chartService.listTopInterfaceInvoke(3);
        return ResultUtils.success(interfaceInfoVOS);
    }
}
